<script>
	import config from './config'
	import store from '@/store'
	import {
		getToken
	} from '@/utils/auth'

	export default {
		onLaunch: function() {
			this.initApp()
		},
		methods: {
			// 初始化应用
			initApp() {
				// 初始化应用配置
				this.initConfig()
				// 检查用户登录状态
				//#ifdef H5
				this.checkLogin()
				//#endif
			},
			initConfig() {
				this.globalData.config = config
			},
			// 初始访问不同链接的处理
			checkLogin() {
				const whiteList = [
					"/pages/index",
					"/pages/team/index",
					// "/pages/mine/index",


					'/pages/login',
					'/pages/register',
					'/pages/help',
					'/pages/record',

					'/pages/payLoading',
					'/pages/loading',

					'/pages/ordinary',
					'/pages/bd',

					'/pages/professional',
					'/pages/bdp',

					'/pages/marriage',
					'/pages/check',
					'/pages/mar',

					'/pages/judicial',
					'/pages/jud',

					'/pages/company',
					'/pages/qyns',
					'/pages/com',

					'/pages/immovables',
					'/pages/imm',

					'/pages/education',
					'/pages/edu',

					'/pages/military',
					'/pages/mili',
					
					'/pages/pwd',
				]
				// var path = window.location.hash.slice(1, window.location.hash.indexOf('?'))
				var path = window.location.pathname
				console.log('---App---')
				console.log('path：', path)
				console.log('checkWhite：', whiteList.indexOf(path) !== -1)
				if (whiteList.indexOf(path) !== -1) {
					return
				}
				// if (!getToken()) {
				// 	this.$tab.reLaunch('/pages/login')
				// }
			}
		}
	}
</script>

<style lang="scss">
	@import url('@/static/scss/index.scss');
	@import url("@/static/font/iconfont02.css");

	.home-container uni-swiper .uni-swiper-dot {
		width: 24rpx;
		height: 2rpx;
		background-color: rgba(255, 255, 255, 0.20);
	}

	.home-container uni-swiper .uni-swiper-dot-active {
		width: 24rpx;
		height: 2rpx;
		background-color: #fff;
	}
	
	uni-button{
		padding: 10px;
	}
</style>